<template>
	<view :class="['YmContent',{'dark':theme=='dark'}]">
				<view :class="['application_for_withdrawal_71',{'dark':theme=='dark'}]">
					<text decode="true" class="application_for_withdrawal_74">{{$t('bico.W558')}}</text>
					
					<view class="application_for_withdrawal_75">
						
						<input type="digit" v-model="price" @input="inputNum" class="application_for_withdrawal_77" />
						<text decode="true" class="application_for_withdrawal_76">{{coin}} </text>
					</view>
					<view class="application_for_withdrawal_81">
						<text decode="true" class="application_for_withdrawal_82">{{$t('bico.W559')}} {{mydata}} {{coin}}</text>
						<!-- <text decode="true" class="application_for_withdrawal_83">划转记录</text> -->
					</view>
					<button v-on:click="submit()" class="btSubmit">{{$t('bico.W557')}}
					</button>
				</view>
	</view>
</template>

<script>
	import {mapState,mapActions,mapGetters} from 'vuex';
	import {myearnings,freeTransferForWallet} from '../../common/apiString.js'
	export default{
		data(){
			return{
				price:'',
				mydata:1000,
				coin:"U"
			}
		},
		computed:{
			...mapState({
			  theme:state=>state.theme
			}),
		},
		onLoad() {
			uni.setNavigationBarTitle({
				title:this.$t('bico.W553'),
			})
			this.$utils.setTheme(this.theme);
			this.getList();
		},
		methods: {
			inputNum(val){
				if(val.detail.value>this.mydata){
					this.$utils.showLayer(this.$t('bico.W554')+" "+this.mydata+"USDT");
					this.price=this.mydata
				}
			},
			getList() {
				var that = this;
				this.$utils.initDataToken({url:myearnings,data:{},type:'POST'},(res,msg)=>{
						that.mydata=res==''?0:res.usedPrice
						that.coin = res.type
					});
			},
			submit(){
				console.log(this.price)
				if(this.price<=0){
					this.$utils.showLayer(this.$t('bico.W555'),);
					return
				}
				if(this.price>this.mydata){
					this.$utils.showLayer(this.$t('bico.W554'),+this.mydata);
					return
				}
				this.$utils.initDataToken({url:freeTransferForWallet,data:{price:this.price},type:'POST'},(res,msg)=>{
						this.$utils.showLayer(this.$t('bico.W556'),);
						this.getList()
						this.price=''
					});
				
			}
		},
	}
</script>

<style>
html,body,#app {height: 100%;width: 100%;}
.YmContent {height: 100%;width: 100%;}
uni-page-body,#app {height: 100%;}
button::after {border: none;width: auto;}
input{outline: none;border: none;list-style: none;width: auto;}
.list_item{float: left;}
.ym_hide{display: none;}
.ym_show{display: block;}
.slide-image {  width: 100%;  height:100%;}
.list_horizontal {width: auto; display:inline-block; }
 .application_for_withdrawal_71{white-space:normal;width:749upx;height:100%;padding:0upx;clear:both;float:left;border-radius:0upx;font-size:8upx;}
 .application_for_withdrawal_71 .application_for_withdrawal_74{white-space:normal;width:181upx;padding:0upx;clear:both;margin-top:30upx;margin-left:34upx;float:left; border-radius:0upx; color:#646464;font-size:32upx; }
 .application_for_withdrawal_71 .application_for_withdrawal_75{white-space:normal;width:647upx;padding:0upx;clear:both;margin-top:68upx;margin-left:34upx;float:left; border-radius:0upx;font-size:43upx; }
 .application_for_withdrawal_71 .application_for_withdrawal_75 .application_for_withdrawal_76{white-space:normal;width:auto;padding:0upx;margin-top:0upx;margin-left:0upx;float:left; border-radius:0upx; color:#646464;font-size:43upx; }
 .application_for_withdrawal_71 .application_for_withdrawal_75 .application_for_withdrawal_77{white-space:normal;width:auto;padding:0upx;margin-top:0upx;margin-left:25upx;float:left; border-radius:0upx; color:#c8c8c8;font-size:43upx; }
 .application_for_withdrawal_71 .application_for_withdrawal_81{white-space:normal;width:704upx;padding:0upx;clear:both;margin-top:85upx;margin-left:32upx;float:left; border-radius:0upx;font-size:29upx; }
 .application_for_withdrawal_71 .application_for_withdrawal_81 .application_for_withdrawal_82{white-space:normal;width:377upx;padding:0upx;margin-top:0upx;margin-left:0upx;float:left; border-radius:0upx; color:#c8c8c8;font-size:29upx; }
 .application_for_withdrawal_71 .application_for_withdrawal_81 .application_for_withdrawal_83{white-space:normal;width:128upx;padding:0upx;margin-top:0upx;margin-left:186upx;float:left; border-radius:0upx; color:#454d7b;font-size:29upx; }
 .application_for_withdrawal_71 .payType{white-space:normal;width:683upx;clear:both;margin-top:64upx;margin-left:33upx;float:left; border-radius:0upx;font-size:49upx; }
 .application_for_withdrawal_71 .payType .application_for_withdrawal_85{white-space:normal;width:46upx;padding:0upx;margin-top:3upx;margin-left:2upx;float:left; border-radius:0upx;font-size:48upx; }
 .application_for_withdrawal_71 .payType .application_for_withdrawal_86{white-space:normal;width:61upx;padding:0upx;margin-top:11upx;margin-left:23upx;float:left; border-radius:0upx; color:#646464;font-size:27upx; }
 .application_for_withdrawal_71 .payType .application_for_withdrawal_87{white-space:normal;width:43upx;padding:0upx;margin-top:2upx;margin-left:4upx;float:left; border-radius:0upx;font-size:43upx; }
 .application_for_withdrawal_71 .payType .application_for_withdrawal_88{white-space:normal;width:47upx;padding:0upx;margin-top:3upx;margin-left:105upx;float:left; border-radius:0upx;font-size:49upx; }
 .application_for_withdrawal_71 .payType .application_for_withdrawal_89{white-space:normal;width:81upx;padding:0upx;margin-top:11upx;margin-left:22upx;float:left; border-radius:0upx; color:#646464;font-size:27upx; }
 .application_for_withdrawal_71 .payType .application_for_withdrawal_90{white-space:normal;width:43upx;padding:0upx;margin-top:3upx;margin-left:11upx;float:left; border-radius:0upx;font-size:42upx; }
 .application_for_withdrawal_71 .btSubmit{white-space:normal;width:679upx;padding:0upx;clear:both;margin-top:63upx;margin-left:35upx;float:left;background-color:#007aff;text-align:center;justify-content:center; border-radius:10upx; cursor:pointer; color:#ffffff;font-size:27upx; }
 .application_for_withdrawal_71 .btSubmit_label{float:left;}
 .application_for_withdrawal_71 .btSubmit_button{float:left;color:#000000;font-size:30rpx;text-align:center;border-color:#e1e1e1;border-width: 1rpx;border-style:solid;border-radius:5rpx;padding:10rpx;margin:15rpx;}
 .application_for_withdrawal_71 .btSubmit_button_select{float:left;color:#ff8000;font-size:30rpx;text-align:center;border-color:#007aff;border-width: 1rpx;border-style:solid;border-radius:5rpx;padding:10rpx;margin:15rpx;}
 .application_for_withdrawal_71 .btSubmit_title{float:left;}
</style>
